﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Enferno.StormApiClient.Shopping;

namespace Enferno.Public.Web.Models
{
    public class BasketModel : BasketBaseModel<BasketItemModel, PromotionModel, OnHandStatusModel, PriceModel, ProductFileModel>
    {
        
    }

    public class BasketBaseModel<TBasketItemModel, TPromotionModel, TOnHandStatusModel, TPriceModel, TProductFileModel>
        where TBasketItemModel: BasketItemBaseModel<TPriceModel>
        where TPromotionModel: PromotionBaseModel<TProductFileModel>
        where TOnHandStatusModel: OnHandStatusModel
        where TPriceModel: PriceModel
        where TProductFileModel: ProductFileModel
    {
        public BasketBaseModel()
        {
            Items = new List<TBasketItemModel>();
            Freights = new List<TBasketItemModel>();
            Payments = new List<TBasketItemModel>();
            Promotions = new List<TPromotionModel>();
        }

        public int Id { get; private set; }
        public List<TBasketItemModel> Items { get; set; }
        public List<TBasketItemModel> Freights { get; set; }
        public List<TBasketItemModel> Payments { get; set; } 

        public List<TPromotionModel> Promotions { get; set; }
        public string DiscountCode { get; set; }
        public int? CustomerId { get; set; }
        public int? CompanyId { get; set; }
        public TOnHandStatusModel OnHand { get; set; }
        public string Comment { get; set; }
        public string OrderReference { get; set; }
    }
}
